package com.learn.game_challenger.UI;

import com.learn.game_challenger.entity.role;

import java.util.Scanner;

public class setPlayer {
    public static role SetPlayer() {
        System.out.println("欢迎来到地下冒险！请创建你的初始角色");
        Scanner scanner = new Scanner(System.in);

        System.out.print("请输入角色名称: ");
        String name = scanner.nextLine();

        System.out.print("你的初始攻击力和防御力之和为10，请你仔细思考，合理分配\n你选择的攻击力为: ");
        int attack = scanner.nextInt();

        int defense = 10-attack;

        System.out.print("你的初始生命值为: 100\n");
        int health = 100;

        role challenger = new role(name, attack, defense, health);

        // 打印创建的角色信息
        System.out.println("创建的角色信息: ");
        System.out.println("名称: " + challenger.getName());
        System.out.println("攻击力: " + challenger.getAttack());
        System.out.println("防御力: " + challenger.getDefense());
        System.out.println("生命值: " + challenger.getHealth());

        return challenger;
    }
}

